<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>Graph (Closure Compiler)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="Graph (Closure Compiler)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/google/javascript/jscomp/graph/FixedPointGraphTraversal.EdgeCallback.html" title="interface in com.google.javascript.jscomp.graph"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../com/google/javascript/jscomp/graph/Graph.GraphEdge.html" title="interface in com.google.javascript.jscomp.graph"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/google/javascript/jscomp/graph/Graph.html" target="_top">Frames</a></li>
<li><a href="Graph.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested_class_summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.google.javascript.jscomp.graph</div>
<h2 title="Class Graph" class="title">Class Graph&lt;N,E&gt;</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.google.javascript.jscomp.graph.Graph&lt;N,E&gt;</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>N</code> - Value type that the graph node stores.</dd><dd><code>E</code> - Value type that the graph edge stores.</dd></dl>
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../../com/google/javascript/jscomp/graph/AdjacencyGraph.html" title="interface in com.google.javascript.jscomp.graph">AdjacencyGraph</a>&lt;N,E&gt;</dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../../com/google/javascript/jscomp/graph/DiGraph.html" title="class in com.google.javascript.jscomp.graph">DiGraph</a>, <a href="../../../../../com/google/javascript/jscomp/graph/UndiGraph.html" title="class in com.google.javascript.jscomp.graph">UndiGraph</a></dd>
</dl>
<hr>
<br>
<pre>public abstract class <span class="strong">Graph&lt;N,E&gt;</span>
extends java.lang.Object
implements <a href="../../../../../com/google/javascript/jscomp/graph/AdjacencyGraph.html" title="interface in com.google.javascript.jscomp.graph">AdjacencyGraph</a>&lt;N,E&gt;</pre>
<div class="block">The base generic class for graph-like data structure and algorithms in
 the compiler.
 <p>
 Nodes and edges in the graph can store a piece of data that this graph is
 used to represent. For example, a variable interference graph might store a
 variable in the node. This piece of data can be accessed with
 <a href="../../../../../com/google/javascript/jscomp/graph/GraphNode.html#getValue()"><code>GraphNode.getValue()</code></a> and <a href="../../../../../com/google/javascript/jscomp/graph/Graph.GraphEdge.html#getValue()"><code>Graph.GraphEdge.getValue()</code></a>.
 <p>
 Algorithms and analysis can annotate information on the nodes and edges
 using <a href="../../../../../com/google/javascript/jscomp/graph/GraphNode.html#getValue()"><code>GraphNode.getValue()</code></a> and <a href="../../../../../com/google/javascript/jscomp/graph/Graph.GraphEdge.html#getValue()"><code>Graph.GraphEdge.getValue()</code></a>. For example,
 a graph coloring algorithm can store the color as an annotation. If multiple
 analyses are required, it is up to the user of the analysis to save the
 annotated solution between passes.
 <p>
 We implemented our own graph data structure (as opposed to using
 <code>com.google.common.graph</code>) for two reasons. First, aside from
 the node's label value, we would like to annotate information on the nodes
 and edges. Using a map to annotate would introduce too much overhead during
 fix point analysis. Also, <code>com.google.common.graph</code> does not
 support labeling of edges. Secondly, not using another external package would
 limit our dependencies.
 <p>
 TODO(user): All functionality for removing nodes and edges.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested_class_summary">
<!--   -->
</a>
<h3>Nested Class Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static interface&nbsp;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.GraphEdge.html" title="interface in com.google.javascript.jscomp.graph">Graph.GraphEdge</a>&lt;<a href="../../../../../com/google/javascript/jscomp/graph/Graph.GraphEdge.html" title="type parameter in Graph.GraphEdge">N</a>,<a href="../../../../../com/google/javascript/jscomp/graph/Graph.GraphEdge.html" title="type parameter in Graph.GraphEdge">E</a>&gt;</strong></code>
<div class="block">A generic edge.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#Graph()">Graph</a></strong>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#clearEdgeAnnotations()">clearEdgeAnnotations</a></strong>()</code>
<div class="block">Makes each edge's annotation null.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#clearNodeAnnotations()">clearNodeAnnotations</a></strong>()</code>
<div class="block">Makes each node's annotation null.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#connect(N, E, N)">connect</a></strong>(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n1,
       <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&nbsp;edge,
       <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n2)</code>
<div class="block">Connects two nodes in the graph with an edge.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#connectIfNotFound(N, E, N)">connectIfNotFound</a></strong>(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n1,
                 <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&nbsp;edge,
                 <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n2)</code>
<div class="block">Connects two nodes in the graph with an edge if such edge does not already
 exists between the nodes.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract <a href="../../../../../com/google/javascript/jscomp/graph/GraphNode.html" title="interface in com.google.javascript.jscomp.graph">GraphNode</a>&lt;<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>,<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#createNode(N)">createNode</a></strong>(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;value)</code>
<div class="block">Gets a node from the graph given a value.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#disconnect(N, N)">disconnect</a></strong>(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n1,
          <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n2)</code>
<div class="block">Disconnects two nodes in the graph by removing all edges between them.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract java.util.List&lt;? extends <a href="../../../../../com/google/javascript/jscomp/graph/Graph.GraphEdge.html" title="interface in com.google.javascript.jscomp.graph">Graph.GraphEdge</a>&lt;<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>,<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&gt;&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#getEdges()">getEdges</a></strong>()</code>
<div class="block">Gets an immutable list of all edges.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract java.util.List&lt;? extends <a href="../../../../../com/google/javascript/jscomp/graph/Graph.GraphEdge.html" title="interface in com.google.javascript.jscomp.graph">Graph.GraphEdge</a>&lt;<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>,<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&gt;&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#getEdges(N, N)">getEdges</a></strong>(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n1,
        <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n2)</code>
<div class="block">Retrieves an edge from the graph.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract <a href="../../../../../com/google/javascript/jscomp/graph/Graph.GraphEdge.html" title="interface in com.google.javascript.jscomp.graph">Graph.GraphEdge</a>&lt;<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>,<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#getFirstEdge(N, N)">getFirstEdge</a></strong>(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n1,
            <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n2)</code>
<div class="block">Retrieves any edge from the graph.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract java.util.List&lt;<a href="../../../../../com/google/javascript/jscomp/graph/GraphNode.html" title="interface in com.google.javascript.jscomp.graph">GraphNode</a>&lt;<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>,<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&gt;&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#getNeighborNodes(N)">getNeighborNodes</a></strong>(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;value)</code>
<div class="block">Gets the neighboring nodes.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract java.util.Iterator&lt;<a href="../../../../../com/google/javascript/jscomp/graph/GraphNode.html" title="interface in com.google.javascript.jscomp.graph">GraphNode</a>&lt;<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>,<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&gt;&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#getNeighborNodesIterator(N)">getNeighborNodesIterator</a></strong>(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;value)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#getNodeDegree(N)">getNodeDegree</a></strong>(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;value)</code>
<div class="block">Gets the degree of a node.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract java.util.Collection&lt;? extends <a href="../../../../../com/google/javascript/jscomp/graph/GraphNode.html" title="interface in com.google.javascript.jscomp.graph">GraphNode</a>&lt;<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>,<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&gt;&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#getNodes()">getNodes</a></strong>()</code>
<div class="block">Gets an immutable list of all nodes.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#getWeight(N)">getWeight</a></strong>(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;value)</code>
<div class="block">Returns a weight for the given value to be used in ordering nodes, e.g.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#hasNode(N)">hasNode</a></strong>(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n)</code>
<div class="block">Checks whether the node exists in the graph (<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#createNode(N)"><code>createNode(Object)</code></a>
 has been called with that value).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#isConnected(N, E, N)">isConnected</a></strong>(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n1,
           <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&nbsp;e,
           <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n2)</code>
<div class="block">Checks whether two nodes in the graph are connected by the given
 edge type.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#isConnected(N, N)">isConnected</a></strong>(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n1,
           <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n2)</code>
<div class="block">Checks whether two nodes in the graph are connected.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#popEdgeAnnotations()">popEdgeAnnotations</a></strong>()</code>
<div class="block">Restores edges' annotation values to state before last
 <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#pushEdgeAnnotations()"><code>pushEdgeAnnotations()</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#popNodeAnnotations()">popNodeAnnotations</a></strong>()</code>
<div class="block">Restores nodes' annotation values to state before last
 <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#pushNodeAnnotations()"><code>pushNodeAnnotations()</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#pushEdgeAnnotations()">pushEdgeAnnotations</a></strong>()</code>
<div class="block">Pushes edges' annotation values.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#pushNodeAnnotations()">pushNodeAnnotations</a></strong>()</code>
<div class="block">Pushes nodes' annotation values.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_com.google.javascript.jscomp.graph.AdjacencyGraph">
<!--   -->
</a>
<h3>Methods inherited from interface&nbsp;com.google.javascript.jscomp.graph.<a href="../../../../../com/google/javascript/jscomp/graph/AdjacencyGraph.html" title="interface in com.google.javascript.jscomp.graph">AdjacencyGraph</a></h3>
<code><a href="../../../../../com/google/javascript/jscomp/graph/AdjacencyGraph.html#getNode(N)">getNode</a>, <a href="../../../../../com/google/javascript/jscomp/graph/AdjacencyGraph.html#newSubGraph()">newSubGraph</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="Graph()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Graph</h4>
<pre>public&nbsp;Graph()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="connect(java.lang.Object,java.lang.Object,java.lang.Object)">
<!--   -->
</a><a name="connect(N, E, N)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>connect</h4>
<pre>public abstract&nbsp;void&nbsp;connect(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n1,
           <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&nbsp;edge,
           <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n2)</pre>
<div class="block">Connects two nodes in the graph with an edge.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>n1</code> - First node.</dd><dd><code>edge</code> - The edge.</dd><dd><code>n2</code> - Second node.</dd></dl>
</li>
</ul>
<a name="disconnect(java.lang.Object,java.lang.Object)">
<!--   -->
</a><a name="disconnect(N, N)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>disconnect</h4>
<pre>public abstract&nbsp;void&nbsp;disconnect(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n1,
              <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n2)</pre>
<div class="block">Disconnects two nodes in the graph by removing all edges between them.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>n1</code> - First node.</dd><dd><code>n2</code> - Second node.</dd></dl>
</li>
</ul>
<a name="connectIfNotFound(java.lang.Object,java.lang.Object,java.lang.Object)">
<!--   -->
</a><a name="connectIfNotFound(N, E, N)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>connectIfNotFound</h4>
<pre>public final&nbsp;void&nbsp;connectIfNotFound(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n1,
                     <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&nbsp;edge,
                     <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n2)</pre>
<div class="block">Connects two nodes in the graph with an edge if such edge does not already
 exists between the nodes.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>n1</code> - First node.</dd><dd><code>edge</code> - The edge.</dd><dd><code>n2</code> - Second node.</dd></dl>
</li>
</ul>
<a name="createNode(java.lang.Object)">
<!--   -->
</a><a name="createNode(N)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createNode</h4>
<pre>public abstract&nbsp;<a href="../../../../../com/google/javascript/jscomp/graph/GraphNode.html" title="interface in com.google.javascript.jscomp.graph">GraphNode</a>&lt;<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>,<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&gt;&nbsp;createNode(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;value)</pre>
<div class="block">Gets a node from the graph given a value. New nodes are created if that
 value has not been assigned a graph node. Values equality are compared
 using <code>Object.equals</code>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>value</code> - The node's value.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The corresponding node in the graph.</dd></dl>
</li>
</ul>
<a name="getNodes()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNodes</h4>
<pre>public abstract&nbsp;java.util.Collection&lt;? extends <a href="../../../../../com/google/javascript/jscomp/graph/GraphNode.html" title="interface in com.google.javascript.jscomp.graph">GraphNode</a>&lt;<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>,<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&gt;&gt;&nbsp;getNodes()</pre>
<div class="block">Gets an immutable list of all nodes.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../com/google/javascript/jscomp/graph/AdjacencyGraph.html#getNodes()">getNodes</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../com/google/javascript/jscomp/graph/AdjacencyGraph.html" title="interface in com.google.javascript.jscomp.graph">AdjacencyGraph</a>&lt;<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>,<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&gt;</code></dd>
</dl>
</li>
</ul>
<a name="getEdges()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEdges</h4>
<pre>public abstract&nbsp;java.util.List&lt;? extends <a href="../../../../../com/google/javascript/jscomp/graph/Graph.GraphEdge.html" title="interface in com.google.javascript.jscomp.graph">Graph.GraphEdge</a>&lt;<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>,<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&gt;&gt;&nbsp;getEdges()</pre>
<div class="block">Gets an immutable list of all edges.</div>
</li>
</ul>
<a name="getNodeDegree(java.lang.Object)">
<!--   -->
</a><a name="getNodeDegree(N)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNodeDegree</h4>
<pre>public abstract&nbsp;int&nbsp;getNodeDegree(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;value)</pre>
<div class="block">Gets the degree of a node.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>value</code> - The node's value.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The degree of the node.</dd></dl>
</li>
</ul>
<a name="getWeight(java.lang.Object)">
<!--   -->
</a><a name="getWeight(N)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWeight</h4>
<pre>public&nbsp;int&nbsp;getWeight(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;value)</pre>
<div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../../../../com/google/javascript/jscomp/graph/AdjacencyGraph.html#getWeight(N)">AdjacencyGraph</a></code></strong></div>
<div class="block">Returns a weight for the given value to be used in ordering nodes, e.g.
 in <a href="../../../../../com/google/javascript/jscomp/graph/GraphColoring.html" title="class in com.google.javascript.jscomp.graph"><code>GraphColoring</code></a>.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../com/google/javascript/jscomp/graph/AdjacencyGraph.html#getWeight(N)">getWeight</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../com/google/javascript/jscomp/graph/AdjacencyGraph.html" title="interface in com.google.javascript.jscomp.graph">AdjacencyGraph</a>&lt;<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>,<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&gt;</code></dd>
</dl>
</li>
</ul>
<a name="getNeighborNodes(java.lang.Object)">
<!--   -->
</a><a name="getNeighborNodes(N)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNeighborNodes</h4>
<pre>public abstract&nbsp;java.util.List&lt;<a href="../../../../../com/google/javascript/jscomp/graph/GraphNode.html" title="interface in com.google.javascript.jscomp.graph">GraphNode</a>&lt;<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>,<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&gt;&gt;&nbsp;getNeighborNodes(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;value)</pre>
<div class="block">Gets the neighboring nodes.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>value</code> - The node's value.</dd>
<dt><span class="strong">Returns:</span></dt><dd>A list of neighboring nodes.</dd></dl>
</li>
</ul>
<a name="getNeighborNodesIterator(java.lang.Object)">
<!--   -->
</a><a name="getNeighborNodesIterator(N)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNeighborNodesIterator</h4>
<pre>public abstract&nbsp;java.util.Iterator&lt;<a href="../../../../../com/google/javascript/jscomp/graph/GraphNode.html" title="interface in com.google.javascript.jscomp.graph">GraphNode</a>&lt;<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>,<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&gt;&gt;&nbsp;getNeighborNodesIterator(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;value)</pre>
</li>
</ul>
<a name="getEdges(java.lang.Object,java.lang.Object)">
<!--   -->
</a><a name="getEdges(N, N)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEdges</h4>
<pre>public abstract&nbsp;java.util.List&lt;? extends <a href="../../../../../com/google/javascript/jscomp/graph/Graph.GraphEdge.html" title="interface in com.google.javascript.jscomp.graph">Graph.GraphEdge</a>&lt;<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>,<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&gt;&gt;&nbsp;getEdges(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n1,
                                                      <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n2)</pre>
<div class="block">Retrieves an edge from the graph.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>n1</code> - Node one.</dd><dd><code>n2</code> - Node two.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The list of edges between those two values in the graph.</dd></dl>
</li>
</ul>
<a name="getFirstEdge(java.lang.Object,java.lang.Object)">
<!--   -->
</a><a name="getFirstEdge(N, N)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFirstEdge</h4>
<pre>public abstract&nbsp;<a href="../../../../../com/google/javascript/jscomp/graph/Graph.GraphEdge.html" title="interface in com.google.javascript.jscomp.graph">Graph.GraphEdge</a>&lt;<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>,<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&gt;&nbsp;getFirstEdge(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n1,
                                <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n2)</pre>
<div class="block">Retrieves any edge from the graph.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>n1</code> - Node one.</dd><dd><code>n2</code> - Node two.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The first edges between those two values in the graph. null if
    there are none.</dd></dl>
</li>
</ul>
<a name="hasNode(java.lang.Object)">
<!--   -->
</a><a name="hasNode(N)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasNode</h4>
<pre>public final&nbsp;boolean&nbsp;hasNode(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n)</pre>
<div class="block">Checks whether the node exists in the graph (<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#createNode(N)"><code>createNode(Object)</code></a>
 has been called with that value).</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>n</code> - Node.</dd>
<dt><span class="strong">Returns:</span></dt><dd><code>true</code> if it exist.</dd></dl>
</li>
</ul>
<a name="isConnected(java.lang.Object,java.lang.Object)">
<!--   -->
</a><a name="isConnected(N, N)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isConnected</h4>
<pre>public abstract&nbsp;boolean&nbsp;isConnected(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n1,
                  <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n2)</pre>
<div class="block">Checks whether two nodes in the graph are connected.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>n1</code> - Node 1.</dd><dd><code>n2</code> - Node 2.</dd>
<dt><span class="strong">Returns:</span></dt><dd><code>true</code> if the two nodes are connected.</dd></dl>
</li>
</ul>
<a name="isConnected(java.lang.Object,java.lang.Object,java.lang.Object)">
<!--   -->
</a><a name="isConnected(N, E, N)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isConnected</h4>
<pre>public abstract&nbsp;boolean&nbsp;isConnected(<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n1,
                  <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&nbsp;e,
                  <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>&nbsp;n2)</pre>
<div class="block">Checks whether two nodes in the graph are connected by the given
 edge type.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>n1</code> - Node 1.</dd><dd><code>e</code> - The edge type.</dd><dd><code>n2</code> - Node 2.</dd></dl>
</li>
</ul>
<a name="clearNodeAnnotations()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clearNodeAnnotations</h4>
<pre>public final&nbsp;void&nbsp;clearNodeAnnotations()</pre>
<div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../../../../com/google/javascript/jscomp/graph/AdjacencyGraph.html#clearNodeAnnotations()">AdjacencyGraph</a></code></strong></div>
<div class="block">Makes each node's annotation null.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../com/google/javascript/jscomp/graph/AdjacencyGraph.html#clearNodeAnnotations()">clearNodeAnnotations</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../com/google/javascript/jscomp/graph/AdjacencyGraph.html" title="interface in com.google.javascript.jscomp.graph">AdjacencyGraph</a>&lt;<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">N</a>,<a href="../../../../../com/google/javascript/jscomp/graph/Graph.html" title="type parameter in Graph">E</a>&gt;</code></dd>
</dl>
</li>
</ul>
<a name="clearEdgeAnnotations()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clearEdgeAnnotations</h4>
<pre>public final&nbsp;void&nbsp;clearEdgeAnnotations()</pre>
<div class="block">Makes each edge's annotation null.</div>
</li>
</ul>
<a name="pushNodeAnnotations()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>pushNodeAnnotations</h4>
<pre>public final&nbsp;void&nbsp;pushNodeAnnotations()</pre>
<div class="block">Pushes nodes' annotation values. Restored with
 <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#popNodeAnnotations()"><code>popNodeAnnotations()</code></a>. Nodes' annotation values are cleared.</div>
</li>
</ul>
<a name="popNodeAnnotations()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>popNodeAnnotations</h4>
<pre>public final&nbsp;void&nbsp;popNodeAnnotations()</pre>
<div class="block">Restores nodes' annotation values to state before last
 <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#pushNodeAnnotations()"><code>pushNodeAnnotations()</code></a>.</div>
</li>
</ul>
<a name="pushEdgeAnnotations()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>pushEdgeAnnotations</h4>
<pre>public final&nbsp;void&nbsp;pushEdgeAnnotations()</pre>
<div class="block">Pushes edges' annotation values. Restored with
 <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#popEdgeAnnotations()"><code>popEdgeAnnotations()</code></a>. Edges' annotation values are cleared.</div>
</li>
</ul>
<a name="popEdgeAnnotations()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>popEdgeAnnotations</h4>
<pre>public final&nbsp;void&nbsp;popEdgeAnnotations()</pre>
<div class="block">Restores edges' annotation values to state before last
 <a href="../../../../../com/google/javascript/jscomp/graph/Graph.html#pushEdgeAnnotations()"><code>pushEdgeAnnotations()</code></a>.</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/google/javascript/jscomp/graph/FixedPointGraphTraversal.EdgeCallback.html" title="interface in com.google.javascript.jscomp.graph"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../com/google/javascript/jscomp/graph/Graph.GraphEdge.html" title="interface in com.google.javascript.jscomp.graph"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/google/javascript/jscomp/graph/Graph.html" target="_top">Frames</a></li>
<li><a href="Graph.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested_class_summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
